#Sunway
MPICC =mpicc 
CC    =mpicc 
CFLAGS= -OPT:IEEE_arith=1 -O3
LIBS= -lm -L../externlib/gptl/lib -lgptl_sw
INC=-I../externlib/gptl/include


OBJS = main.o allocate.o rtmlib.o assistant.o initialization.o propagation.o boundarympi.o  boundaryio.o  propagation_opt.o slave.o  slave0.o  slave1.o slave2.o slave3.o slave4.o

../bin/rtm3d : ${OBJS}
	$(MPICC) $(CFLAGS) -hybrid -o $@ $^  $(LIBS) -lm_slave
.c.o :
	$(MPICC)  $(CFLAGS) -c  $<   $(INC)
slave.o : slave.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  
slave0.o : slave0.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  
slave1.o : slave1.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  
slave2.o : slave2.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  
slave3.o : slave3.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  
slave4.o : slave4.c 
	sw5cc -slave $(CFLAGS) -msimd -c $<  


clean:
	rm  -rf *.o  ../bin/rtm3d


##intel/GNU
#MPICC=mpiicc
#CC   =mpiicc
#CFLAGS=-O3 
#LIBS= -lm -L../externlib/gptl/lib -lgptl
#INC=-I../externlib/gptl/include
#
#OBJS = main.o allocate.o rtmlib.o assistant.o initialization.o propagation.o boundarympi.o  boundaryio.o  
#
#../bin/rtm3d : ${OBJS}
#	$(MPICC) $(CFLAGS)  -o $@ $^  $(LIBS) 
#.c.o :
#	$(MPICC)  $(CFLAGS) -c  $<   $(INC)
#
#clean:
#	rm  -rf *.o  ../bin/rtm3d




#mac os
#MPICC=/Users/echo/soft/mpich3/bin/mpicc
#CC=/Users/echo/soft/mpich3/bin/mpicc
#CFLAGS=-O3 
#LIBS= -lm -L../externlib/gptl/lib -lgptl_mac
#INC=-I../externlib/gptl/include

